<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfTextSession</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinftext-0.4 Reference Manual">
<link rel="up" href="ch01.html" title="libinftext API reference">
<link rel="prev" href="ch01.html" title="libinftext API reference">
<link rel="next" href="libinftext-0.4-inf-text-buffer.html" title="inf-text-buffer">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinftext-0.4 Reference Manual</th>
<td><a accesskey="n" href="libinftext-0.4-inf-text-buffer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libinftext-0.4-inf-text-session.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libinftext-0.4-inf-text-session.description" class="shortcut">Description</a>
                   | 
                  <a href="#libinftext-0.4-inf-text-session.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#libinftext-0.4-inf-text-session.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#libinftext-0.4-inf-text-session.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfTextSession">
<a name="libinftext-0.4-inf-text-session"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libinftext-0.4-inf-text-session.top_of_page"></a>InfTextSession</span></h2>
<p>InfTextSession</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="libinftext-0.4-inf-text-session.synopsis"></a><h2>Synopsis</h2>
<a name="InfTextSession"></a><pre class="synopsis">enum                <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSessionError" title="enum InfTextSessionError">InfTextSessionError</a>;
                    <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession-struct" title="InfTextSession">InfTextSession</a>;
<a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="returnvalue">InfTextSession</span></a> *    <a class="link" href="libinftext-0.4-inf-text-session.html#inf-text-session-new" title="inf_text_session_new ()">inf_text_session_new</a>                (<em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfSession.html#InfSessionStatus"><span class="type">InfSessionStatus</span></a> status</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationGroup.html"><span class="type">InfCommunicationGroup</span></a> *sync_group</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfXmlConnection.html"><span class="type">InfXmlConnection</span></a> *sync_connection</code></em>);
<a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="returnvalue">InfTextSession</span></a> *    <a class="link" href="libinftext-0.4-inf-text-session.html#inf-text-session-new-with-user-table" title="inf_text_session_new_with_user_table ()">inf_text_session_new_with_user_table</a>
                                                        (<em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfUserTable.html"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfSession.html#InfSessionStatus"><span class="type">InfSessionStatus</span></a> status</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationGroup.html"><span class="type">InfCommunicationGroup</span></a> *sync_group</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfXmlConnection.html"><span class="type">InfXmlConnection</span></a> *sync_connection</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libinftext-0.4-inf-text-session.html#inf-text-session-set-user-color" title="inf_text_session_set_user_color ()">inf_text_session_set_user_color</a>     (<em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a> *session</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> hue</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libinftext-0.4-inf-text-session.html#inf-text-session-flush-requests-for-user" title="inf_text_session_flush_requests_for_user ()">inf_text_session_flush_requests_for_user</a>
                                                        (<em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a> *session</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> *user</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="libinftext-0.4-inf-text-session.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----<a href="../libinfinity-0.4/InfSession.html">InfSession</a>
         +----<a href="../libinfinity-0.4/InfAdoptedSession.html">InfAdoptedSession</a>
               +----InfTextSession
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="libinftext-0.4-inf-text-session.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfTextSession implements
 <a href="../libinfinity-0.4/InfCommunicationObject.html">InfCommunicationObject</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="libinftext-0.4-inf-text-session.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession--caret-update-interval" title='The "caret-update-interval" property'>caret-update-interval</a>"    <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct
</pre>
</div>
<div class="refsect1" title="Description">
<a name="libinftext-0.4-inf-text-session.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="libinftext-0.4-inf-text-session.details"></a><h2>Details</h2>
<div class="refsect2" title="enum InfTextSessionError">
<a name="InfTextSessionError"></a><h3>enum InfTextSessionError</h3>
<pre class="programlisting">typedef enum _InfTextSessionError {
  INF_TEXT_SESSION_ERROR_INVALID_HUE,

  INF_TEXT_SESSION_ERROR_FAILED
} InfTextSessionError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfTextSession">
<a name="InfTextSession-struct"></a><h3>InfTextSession</h3>
<pre class="programlisting">typedef struct _InfTextSession InfTextSession;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="inf_text_session_new ()">
<a name="inf-text-session-new"></a><h3>inf_text_session_new ()</h3>
<pre class="programlisting"><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="returnvalue">InfTextSession</span></a> *    inf_text_session_new                (<em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfSession.html#InfSessionStatus"><span class="type">InfSessionStatus</span></a> status</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationGroup.html"><span class="type">InfCommunicationGroup</span></a> *sync_group</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfXmlConnection.html"><span class="type">InfXmlConnection</span></a> *sync_connection</code></em>);</pre>
<p>
Creates a new <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>. The communication manager is used to send
and receive requests from subscription and synchronization. <em class="parameter"><code>buffer</code></em> will be
set to be initially empty if the session is initially synchronized
(see below). <em class="parameter"><code>io</code></em> is required to trigger timeouts.
</p>
<p>
If <em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-PRESYNC:CAPS"><code class="literal">INF_SESSION_PRESYNC</code></a> or <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-SYNCHRONIZING:CAPS"><code class="literal">INF_SESSION_SYNCHRONIZING</code></a>, then the
session will initially be sychronized, meaning the initial content is
retrieved from <em class="parameter"><code>sync_connection</code></em>. If you are subscribed to the session, set
the subscription group via <a href="../libinfinity-0.4/InfSession.html#inf-session-set-subscription-group"><code class="function">inf_session_set_subscription_group()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>A <a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>An initial <a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io</code></em> :</span></p></td>
<td>A <a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
<td>The initial status of the session.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_group</code></em> :</span></p></td>
<td>A group in which the session is synchronized. Ignored if
<em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-RUNNING:CAPS"><code class="literal">INF_SESSION_RUNNING</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_connection</code></em> :</span></p></td>
<td>A connection to synchronize the session from. Ignored if
<em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-RUNNING:CAPS"><code class="literal">INF_SESSION_RUNNING</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_new_with_user_table ()">
<a name="inf-text-session-new-with-user-table"></a><h3>inf_text_session_new_with_user_table ()</h3>
<pre class="programlisting"><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="returnvalue">InfTextSession</span></a> *    inf_text_session_new_with_user_table
                                                        (<em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> *io</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfUserTable.html"><span class="type">InfUserTable</span></a> *user_table</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfSession.html#InfSessionStatus"><span class="type">InfSessionStatus</span></a> status</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfCommunicationGroup.html"><span class="type">InfCommunicationGroup</span></a> *sync_group</code></em>,
                                                         <em class="parameter"><code><a href="../libinfinity-0.4/InfXmlConnection.html"><span class="type">InfXmlConnection</span></a> *sync_connection</code></em>);</pre>
<p>
Creates a new <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>. The connection manager is used to send and
receive requests from subscription and synchronization. <em class="parameter"><code>buffer</code></em> will be
set to be initially empty if the session is initially synchronized
(see below). <em class="parameter"><code>io</code></em> is required to trigger timeouts.
</p>
<p>
If <em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-PRESYNC:CAPS"><code class="literal">INF_SESSION_PRESYNC</code></a> or <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-SYNCHRONIZING:CAPS"><code class="literal">INF_SESSION_SYNCHRONIZING</code></a>, then the
session will initially be sychronized, meaning the initial content is
retrieved from <em class="parameter"><code>sync_connection</code></em>. If you are subscribed to the session, set
the subscription group via <a href="../libinfinity-0.4/InfSession.html#inf-session-set-subscription-group"><code class="function">inf_session_set_subscription_group()</code></a>.
</p>
<p>
<em class="parameter"><code>user_table</code></em> is used as an initial user table. The user table should only
contain unavailable users, if any, that may rejoin during the session. If
there was an available user in the user table, it would probably belong
to another session, but different sessions cannot share the same user
object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>A <a href="../libinfinity-0.4/InfCommunicationManager.html"><span class="type">InfCommunicationManager</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>An initial <a class="link" href="libinftext-0.4-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io</code></em> :</span></p></td>
<td>A <a href="../libinfinity-0.4/InfIo.html"><span class="type">InfIo</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_table</code></em> :</span></p></td>
<td>A <a href="../libinfinity-0.4/InfUserTable.html"><span class="type">InfUserTable</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
<td>The initial status for the session.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_group</code></em> :</span></p></td>
<td>A group in which the session is synchronized. Ignored if
<em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-RUNNING:CAPS"><code class="literal">INF_SESSION_RUNNING</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_connection</code></em> :</span></p></td>
<td>A connection to synchronize the session from. Ignored if
<em class="parameter"><code>status</code></em> is <a href="../libinfinity-0.4/InfSession.html#INF-SESSION-RUNNING:CAPS"><code class="literal">INF_SESSION_RUNNING</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_set_user_color ()">
<a name="inf-text-session-set-user-color"></a><h3>inf_text_session_set_user_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_text_session_set_user_color     (<em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a> *session</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> hue</code></em>);</pre>
<p>
Changes the user color of <em class="parameter"><code>user</code></em>. <em class="parameter"><code>user</code></em> must have the <code class="literal">INF_USER_LOCAL</code> flag
set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td>A <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A local <a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> from <em class="parameter"><code>session</code></em>'s user table.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hue</code></em> :</span></p></td>
<td>New hue value for <em class="parameter"><code>user</code></em>'s color. Ranges from 0.0 (red) to 1.0 (red).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_flush_requests_for_user ()">
<a name="inf-text-session-flush-requests-for-user"></a><h3>inf_text_session_flush_requests_for_user ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_text_session_flush_requests_for_user
                                                        (<em class="parameter"><code><a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a> *session</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> *user</code></em>);</pre>
<p>
This function sends all pending requests for <em class="parameter"><code>user</code></em> immediately. Requests
that modify the buffer are not queued normally, but cursor movement
requests are delayed in case are issued frequently, to save bandwidth.
</p>
<p>
The main purpose of this function is to send all pending requests before
changing a user's status to inactive or unavailable since inactive users
are automatically activated as soon as they issue a request.
</p>
<p>
TODO: We should probably detect this automatically, without requiring
people to call this function, i.e. flush requests for local users just
before they become inactive.
</p>
<p>
<em class="parameter"><code>user</code></em> must have the <code class="literal">INF_USER_LOCAL</code> flag set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td>A <a class="link" href="libinftext-0.4-inf-text-session.html#InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>The <a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> for which to flush messages.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="libinftext-0.4-inf-text-session.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "caret-update-interval" property'>
<a name="InfTextSession--caret-update-interval"></a><h3>The <code class="literal">"caret-update-interval"</code> property</h3>
<pre class="programlisting">  "caret-update-interval"    <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct</pre>
<p>Minimum number of milliseconds between caret update broadcasts.</p>
<p>Default value: 500</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>